package com.example.test.configuration;

import org.hibernate.dialect.InnoDBStorageEngine;
import org.hibernate.dialect.MySQL57Dialect;
import org.hibernate.dialect.MySQLStorageEngine;

/**
 * 数据库方言配置
 */
public class DatabaseDialect extends MySQL57Dialect {
    /**
     * 设置默认建表字符集
     */
    @Override
    public String getTableTypeString() {
        return super.getTableTypeString() + " default charset=utf8mb4";
    }

    /**
     * 使用innoDB引擎
     */
    @Override
    protected MySQLStorageEngine getDefaultMySQLStorageEngine() {
        return InnoDBStorageEngine.INSTANCE;
    }
}
